import service from '@/utils/request'

export const useAlarmApi = (id: number) => {
  return service.get('/gps/alarm/' + id)
}

export const useAlarmSubmitApi = (dataForm: any) => {
  if (dataForm.id) {
    return service.put('/gps/alarm', dataForm)
  } else {
    return service.post('/gps/alarm', dataForm)
  }
}
//处理
export const handleAlarmsApi = (id: number) => {
  return service.delete('/gps/alarm/delAlarm?alarmId=' + id)
}

export function useAlarmAllApi(params: any) {
  return service.get('/gps/alarm/allAlarms', {
    params
  })
}
export function getOverdueList(params: any) {
  return service.get('/gps/device/recharge/list', {
    params
  })
}
export function getMediaList(params: any) {
  return service.get('gps/jt808file/list', {
    params
  })
}
export function clearAlarm(imei, alarm) {
  return service.put('gps/alarm/clearAlarm', null, {
    params: {
      imei,
      alarm
    }
  })
}
